﻿using Model;
using NHibernate;
using NHibernate.Expression;

namespace DataAccess
{
    public class PlanningDataAccess : BaseDataAccess
    {

        public Planning GetPlanningByPlanningId(int planningId)
        {
            Planning workOrderTask = new Planning();
            ICriteria crit = m_session.CreateCriteria(typeof(Planning));
            crit.Add(Expression.Eq(Planning.CONST_PLANNING_ID, planningId));
            if (crit.List().Count != 0) workOrderTask = crit.List()[0] as Planning;
            return workOrderTask;
        }
    }
}
